//
//  AppDelegate.swift
//  WeiBo
//
//  Created by wukeng on 16/8/20.
//  Copyright © 2016年 wukeng. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    var defaultViewController : UIViewController?{
        let isLogin = UserAccountViewModel.single.isLogin
        return isLogin ? WelcomeViewController() : UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
    }
    

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        window = UIWindow(frame: UIScreen.mainScreen().bounds)
        window?.makeKeyAndVisible()
        window?.rootViewController = defaultViewController
        
        //全局的tabbar颜色样式
        UITabBar.appearance().tintColor = UIColor.orangeColor()
        UINavigationBar.appearance().tintColor = UIColor.orangeColor()
        
        return true
    }

}

//MARK:- 全局属性
let UIWidth = UIScreen.mainScreen().bounds.size.width
let UIHeight = UIScreen.mainScreen().bounds.size.height
